

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Show Project</title>
    </head>
    <body>
        <div class="undernav">
            <span class="menuButton"><g:link class="create_project" action="create">New Project</g:link></span>
        </div>
        <div class="body">
            <h1>Show Project</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="dialog">
                <table class="detailView">
                    <tbody>
                        <tr >
                            <th>Project Id:</th>
                            <th>Name:</th>
                            <th>Lab:</th>
                            <th>Start Date:</th>
                            <th>End Date:</th>
                        </tr>
                        <tr>
                          <td valign="top" align="left">${fieldValue(bean:projectInstance, field:'projectId')}</td>
                          <td valign="top" >${fieldValue(bean:projectInstance, field:'name')}</td>
                          <td valign="top" ><g:link controller="lab" action="show" id="${projectInstance?.lab?.id}">${projectInstance?.lab?.encodeAsHTML()}</g:link></td>
                          <td valign="top" ><g:formatDate date="${projectInstance.startDate}" format="yyyy-MM-dd" /></td>
                          <td valign="top"><g:formatDate date="${projectInstance.endDate}" format="yyyy-MM-dd" /></td>
                        </tr>
                    </tbody>
                </table>
              <div class="membersView">
                <h2>Members</h2>
                <table>
                  <tbody>
                    <tr>
                      <th>Name</th>
                      <th>Salary</th>
                      <th>Hours in project</th>
                      <th></th>
                    </tr>
                    <g:each var="m" in="${projectInstance.members}">
                    <tr>
                      <td><g:link action="show" controller="employee" id="${m.id}">${m.firstName} ${m.lastName}</g:link></td>
                      <td><g:formatNumber number="${m.salary}" format="SEK ##,##0" /></td>
                      <td></td>
                      <td></td>
                    </tr>
                    </g:each>
                  </tbody>
                </table>
              </div>
            </div>
            <div class="buttons">
                <g:form>
                    <input type="hidden" name="id" value="${projectInstance?.id}" />
                    <span class="button"><g:actionSubmit class="edit_project" value="Edit" /></span>
                    <span class="button"><g:actionSubmit class="delete_project" onclick="return confirm('Are you sure?');" value="Delete" /></span>
                    <span class="button"><g:actionSubmit action ="add_employee" class="add_employee"  value="Add Employee" /></span>
                    <span class="button"><g:actionSubmit action ="delete_employee" class="delete_employee"  value="Remove Employee" /></span>
                </g:form>
            </div>
        </div>
    </body>
</html>
